Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

feat: use appropriate CompletionItemKind for Monaco snippets#514

Merged
takaokouji merged 11 commits into
developfrom
feature/monaco-completion-kinds
Jan 14, 2026
Merged

feat: use appropriate CompletionItemKind for Monaco snippets#514
takaokouji merged 11 commits into
developfrom
feature/monaco-completion-kinds

Conversation

@takaokouji

Copy link
Copy Markdown

Monaco Editorの補完候補に適切な kind を設定するように変更しました。これにより、エディタのGUI上でメソッド、変数、イベントなどのアイコンが正しく表示されるようになります。

変更内容

  • BaseCompleter: item.typemonaco.languages.CompletionItemKind にマップする機能を追加
  • SnippetsCompleter: JSONファイルから type を読み取るように変更
  • 以下のスニペットファイルを更新し、type (method, variable, event, snippet, constant) を追加:
    • motion-snippets.json
    • variables-snippets.json
    • control-snippets.json
    • events-snippets.json
    • looks-snippets.json

Fixes smalruby/smalruby3-develop#17

- Modified BaseCompleter to map item.type to monaco.languages.CompletionItemKind
- Updated SnippetsCompleter to respect type field in JSON
- Added appropriate type (method, variable, event, snippet, constant) to several snippet files
- Fixes smalruby/smalruby3-develop#17
takaokouji and others added 9 commits January 13, 2026 23:45
- Updated sound, sensing, operators, pen, music, video-sensing, text-to-speech,
  translate, microbit, mesh, smalrubot-s1, microbit-more, makey, gdx_for,
  procedure, and koshien snippets
- Categorized each as method, variable, event, snippet, or constant based on their function
- Escaped newlines in snippet strings to prevent build failures
- Reverted unintentional snippet content changes
- Added enum_member mapping in BaseCompleter
- Updated motion-snippets.json to use function, variable, and enum_member types
  based on ruby-generator/motion.js logic
- Updated looks-snippets.json and sound-snippets.json to use function and
  variable types based on their ruby-generator return values
- Updated control-snippets.json and events-snippets.json to use event, snippet,
  and function types based on their ruby-generator logic
- Added value type mapping in BaseCompleter
- Updated all snippet JSON files with appropriate types (function, variable,
  value, enum_member, event, snippet) based on ruby-generator logic
- Fixed unescaped quotes in pen-snippets.json and koshien-snippets.json
- Fixed incorrectly escaped quotes and literal newlines in koshien and microbit snippets
- Configure ESLint to lint JSON files in src/containers/ruby-tab/
- Add eslint-plugin-jsonc and jsonc-eslint-parser
- Fix newline issues and minor snippet syntax errors in JSON files
- Update cspell.json with 'smalrubot'

🤖 Generated with [Gemini Code](https://gemini.google.com/code)

Co-Authored-By: Gemini <noreply@google.com>
- Removed extra spaces from snippet placeholders (e.g., " ${1:value} " → "${1:value}")
- Restored snippets to match develop branch format
- Kept type field additions for Monaco Editor completion

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@takaokouji takaokouji force-pushed the feature/monaco-completion-kinds branch from f2382fd to 5334f96 Compare January 14, 2026 13:41
- Restored placeholders in microbit-snippets.json (e.g., "${1:A}" instead of "A")
- Fixed escape error in operators-snippets.json string.include? snippet
- Kept type field additions for Monaco Editor completion

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@takaokouji takaokouji merged commit aa8fec2 into develop Jan 14, 2026
2 checks passed
@takaokouji takaokouji deleted the feature/monaco-completion-kinds branch January 14, 2026 14:14
github-actions Bot pushed a commit that referenced this pull request Jan 14, 2026
…o-completion-kinds

feat: use appropriate CompletionItemKind for Monaco snippets
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monaco Editorの補完候補に適切なアイコンを表示する

1 participant